<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "" "">
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jstl/core"
	xmlns:om="http://www.apusic.com/jsf/misc">
	<ui:composition>
		<w:script src="/javascript/selectComponent.js" type="text/javascript" language="UTF-8"></w:script>
		<om:elite>
			<![CDATA[
			define req="false";
			define read="true";
			if(defined(required))
			 	req=required;
			if(defined(readOnly))
			 	read=readOnly;
      		]]>
		</om:elite>
		<layout:panelGrid columns="2">
			<c:if test="#{defined(nameField)and(not defined(idField))}">
				<layout:cell>
					<w:textField id="#{nameField}" jsvar="#{nameField+'_jsvar'}" styleClass="k4-form-textfield"
						required="#{req}" requiredMessage="部门不能为空！" readOnly="#{read}" alwaysSubmit="true"></w:textField>
				</layout:cell>
				<layout:cell>
					<a class="k4-selected"
						href="javascript:openKeywordSelectWindow(window,'#{request.contextPath}/component/deptTree.faces',undefined,#{nameField}_jsvar)">选择</a>
				</layout:cell>
			</c:if>
			<c:if test="#{defined(idField)and(not defined(nameField))}">
				<layout:cell>
					<w:textField id="#{idField+'_name'}" jsvar="#{idField+'_name_jsvar'}"
						styleClass="k4-form-textfield" required="#{req}" requiredMessage="部门不能为空！" readOnly="#{read}"
						alwaysSubmit="true"></w:textField>
					<w:textField id="#{idField}" style="display:none;" jsvar="#{idField+'_jsvar'}"
						required="#{req}" requiredMessage="部门不能为空！" readOnly="#{read}" alwaysSubmit="true"></w:textField>
				</layout:cell>
				<layout:cell>
					<a class="k4-selected"
						href="javascript:openKeywordSelectWindow(window,'#{request.contextPath}/component/deptTree.faces',#{idField}_jsvar,#{idField}_name_jsvar)">选择</a>
				</layout:cell>
			</c:if>
			<c:if test="#{defined(idField)and(defined(nameField))}">
				<layout:cell>
					<w:textField id="#{nameField}" jsvar="#{nameField+'_jsvar'}" styleClass="k4-form-textfield"
						required="#{req}" requiredMessage="部门不能为空！" readOnly="#{read}" alwaysSubmit="true"></w:textField>
					<w:textField id="#{idField}" style="display:none;" jsvar="#{idField+'_jsvar'}"
						required="#{req}" requiredMessage="部门不能为空！" readOnly="#{read}" alwaysSubmit="true"></w:textField>
				</layout:cell>
				<layout:cell>
					<a class="k4-selected"
						href="javascript:openKeywordSelectWindow(window,'#{request.contextPath}/component/deptTree.faces',#{idField}_jsvar,#{nameField}_jsvar)">选择</a>
				</layout:cell>
			</c:if>
		</layout:panelGrid>
	</ui:composition>
</f:view>